require('./superDemo.css');
require('./superDemo.less');
let item = require('./girl2.png');


document.body.innerHTML = `
	<div id="box">
		<button id="btn">显示</button>
		<button id="hid">隐藏</button>
	</div>
	<div id="image">
		<img src="${item}"/>
	</div>`;
let img=document.querySelector('img');
img.style.width = '600px';
img.style.height = '400px';

// 方法1
//btn.onclick = function(){
//	img.style.display = 'block';
//};
//
//hid.onclick = function(){
//	img.style.display = 'none';
//}


// 方法2
let body =document.querySelector('body');
body.onclick = function(){
	if(event.target.innerText == '显示'){
		
		img.style.display = 'block';
	};
	if(event.target.innerText == '隐藏'){
		
		img.style.display = 'none';
	}
}




